#ifndef __AOI_H__
#define __AOI_H__

#include "Map.h"
#include "Scene.h"

#define     MAX_MAP_NUM     1000
#define     MAX_SCENE_NUM   30000

struct lua_State;

class AOI
{
    public:
        AOI();
        ~AOI();

        void HeartBeat();

        //Return MapID
        short LoadMap(char* pMapDataFile);

        //Return SceneID
        short AddScene(short nMapID, bool bAOI);

        inline Map* GetMap(short nMapID) {
            if (nMapID >= 0 && nMapID < MAX_MAP_NUM){
                return m_pMaps[nMapID];
            }
            return NULL;
        }

        inline Scene* GetScene(short nSceneID){
            if (nSceneID >=0 && nSceneID < MAX_SCENE_NUM){
                return m_pScenes[nSceneID];
            }
            return NULL;
        }

        //检查与回收无人的副本内对象
        void CheckAndRecycleObjs();

        bool Checker();

    private:
        short m_nMapNum;
        Map* m_pMaps[MAX_MAP_NUM];

        short m_nSceneNum;
        Scene* m_pScenes[MAX_SCENE_NUM];
};


#endif //__AOI_H__
